<template>
  <div class="content-table">
    <el-table :data="parcel"  header-row-class-name="table-header" border :header-cell-style="headStyle" :cell-style="cellStyle" >
      <el-table-column width="200" prop="shop_name" label="门店名称"></el-table-column>
      <el-table-column width="100" prop="theme_name" label="主题名称"></el-table-column>
      <el-table-column width="100" prop="date" label="日期"></el-table-column>
      <el-table-column width="90" prop="week" label="星期"></el-table-column>
      <el-table-column width="50" prop="show_row" label="场次"></el-table-column>
      <el-table-column width="100" prop="show_time" label="时间"></el-table-column>
      <el-table-column width="50" prop="total_number" label="人数"></el-table-column>
      <el-table-column label="预订信息">
        <template slot-scope="scope">
          <div class="" v-for="item in scope.row.show_bill">{{item}}</div>
        </template>
      </el-table-column>
      <el-table-column width="150" prop="remarks" label="备注"></el-table-column>
    </el-table>
    <pager  :total="total" v-if="!!total" @upload="pagerChange"></pager>
  </div>
</template>

<script>
    import Pager from "./pager";
    export default {
      name: "billList",
      components: {Pager},
      props:['parcel','total'],
      data() {
        return {
          cellStyle:{
            "color":"#000",
            "fontSize":"14px"
          },
          tableData: [
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T1",
              "theme_time_id": "316401",
              "begin_time": "2018-09-02 10:30:00+08",
              "end_time": "2018-09-02 12:30:00+08",
              "remarks": "场次备注",
              "total_number": 6,
              "show_time":'10:32-12:00',
              "channel_bill": [
                {
                  "name": "乐惠",
                  "channel": "lehui",
                  "number": "4",
                  "contact": "jinbo.ma",
                  "mobile": "18710648068",
                  "order_no": "123454321"
                },
                {
                  "name": "免费优惠",
                  "channel": "free",
                  "number": "2",
                  "contact": "linlin",
                  "mobile": "18710648068",
                  "order_no": "111111111"
                }
              ],
              "show_bill": [
                "jinbo.ma 18710648068 乐惠X4",
                "linlin 18710648068 免费优惠X2"
              ]
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T2",
              "theme_time_id": "316402",
              "begin_time": "2018-09-02 13:00:00+08",
              "end_time": "2018-09-02 15:00:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T3",
              "theme_time_id": "316403",
              "begin_time": "2018-09-02 15:30:00+08",
              "end_time": "2018-09-02 17:30:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T4",
              "theme_time_id": "316404",
              "begin_time": "2018-09-02 18:00:00+08",
              "end_time": "2018-09-02 20:00:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T5",
              "theme_time_id": "316405",
              "begin_time": "2018-09-02 20:30:00+08",
              "end_time": "2018-09-02 22:30:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-02",
              "week": "星期日",
              "show_row": "T6",
              "theme_time_id": "316406",
              "begin_time": "2018-09-02 23:00:00+08",
              "end_time": "2018-09-03 01:00:00+08",
              "remarks": null,
              "show_time":'10:32-12:00',
              "total_number": 0,
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T1",
              "theme_time_id": "316407",
              "begin_time": "2018-09-03 10:30:00+08",
              "end_time": "2018-09-03 12:30:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T2",
              "theme_time_id": "316408",
              "begin_time": "2018-09-03 13:00:00+08",
              "end_time": "2018-09-03 15:00:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T3",
              "theme_time_id": "316409",
              "begin_time": "2018-09-03 15:30:00+08",
              "end_time": "2018-09-03 17:30:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T4",
              "theme_time_id": "316410",
              "begin_time": "2018-09-03 18:00:00+08",
              "end_time": "2018-09-03 20:00:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T5",
              "theme_time_id": "316411",
              "begin_time": "2018-09-03 20:30:00+08",
              "end_time": "2018-09-03 22:30:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            },
            {
              "shop_name": "消逝的光芒-沉浸式剧场",
              "theme_name": "消逝的光芒",
              "date": "2018-09-03",
              "week": "星期一",
              "show_row": "T6",
              "theme_time_id": "316412",
              "begin_time": "2018-09-03 23:00:00+08",
              "end_time": "2018-09-04 01:00:00+08",
              "remarks": null,
              "total_number": 0,
              "show_time":'10:32-12:00',
              "channel_bill": [],
              "show_bill": []
            }
          ],
          loading:true
        }
      },

      methods: {
        headStyle(){
          return 'background: #F2F2F2;font-size: 14px;color: #9E9E9E;'
        },
        edit(item,row){
          this.$emit('upload',{item,row});
        },
        objectSpanMethod({ row, column, rowIndex, columnIndex }){
          if(columnIndex == 3 ){
            if(rowIndex == 0){
              return{
                rowspan:6,
                colspan:1
              }
            }
          }
        },
        pagerChange(obj){
          this.$emit('upload',obj);
        }

      },
      updated(){
        if(this.parcel.listData && this.parcel.listData.length){
          this.loading = false
        }
      }

    }
</script>

<style scoped>

</style>
